using System;
using System.Runtime.Serialization;

namespace ConsoleTest
{
    [Serializable]
    class TestClass : ISerializable
    {

        private string TestStr;

        public TestClass(string Test) { TestStr = Test; }

        public TestClass(SerializationInfo info, StreamingContext context)
        {
            TestStr = info.GetString("TestStr");
        }

        public override string ToString() { return TestStr; }

        #region ISerializable Members

        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            info.AddValue("TestStr", TestStr);
        }

        #endregion
    }
}